<!doctype html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title>用户登录</title>
  <style type="text/css" media="screen">

.login-form {
  width: 20em;
  height: auto;
  margin: 0 auto;
}

form div {
    clear: left;
    margin: 10px auto;
}

fieldset {
    margin: 1em 0;
    padding: 1em;
    border: 1px solid #ccc;
    background: #f8f8f8;
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    width: 80%;
}

#warning {
    font-size: 12px;
    color: red;
}
  </style>
</head>

<body>
  <form class="login-form" method="post" action="/reg/login/">{% csrf_token %}
    <fieldset>
      <legend>登录</legend>
      <div><label>用户名</label>{{ form.username }}</div>
      <div><label>密码</label>{{ form.password }}</div>
      <div><input type="submit" value="登录" /></div>
      <input type="hidden" name="next" value="{{ next }}" />
      {% if form.errors %}
      <p id="warning">登录失败，请确认用户名和密码正确后重试！</p>
      {% endif %}
    </fieldset>

  </form>

</body>
